







<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>后台管理系统</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../css/global.css?t=1488795362026" media="all">
	<link rel="stylesheet" href="../css/layui.css?t=1488795362026"  >
	<script src="../js/jquery.js"></script>
</head>
<body>
<div class="layui-layout layui-layout-admin">
    

<div class="layui-header header header-demo">
    <div class="layui-main"> <a class="logo" href="/"> </a>
        <ul class="layui-nav" pc>
            <li class="right"> <span> 用户：hippo</span><a href="/logout" class="out">退出</a> </li>
        </ul>
    </div>
</div>
    


<div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
        <ul class="layui-nav layui-nav-tree site-demo-nav">
            <li class="layui-nav-item layui-nav-itemed"><a class="javascript:;" href="javascript:;">基础内容管理</a>
                <dl class="layui-nav-child">
                    <dd class=""><a href="/series/list">系列管理</a></dd>
                    <dd class=""><a href="/live/list">直播管理</a></dd>
                    <dd class=""><a href="/video/list">视频管理</a></dd>
                    <dd class=""><a href="/article/list">图文管理</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item layui-nav-itemed"><a class="javascript:;" href="javascript:;">聚合内容管理</a>
                <dl class="layui-nav-child">
                    
                        <dd class=""><a href="/competition/list">赛事管理</a></dd>
                        <dd class=""><a href="/organization/list">机构管理</a></dd>
                    
                    <dd class=""><a href="/feed/list">标准列表管理</a></dd>
                </dl>
            </li>
            
                <li class="layui-nav-item layui-nav-itemed"><a class="javascript:;" href="javascript:;">Tab管理</a>
                    <dl class="layui-nav-child">
                        <dd class=""><a href="/f1/article/list">F1管理</a></dd>
                        <dd class=""><a href="/ad/list">F1 Banner</a></dd>
                        <dd class=""><a href="/ad/start/list">启动屏广告</a></dd>
                        <dd class=""><a href="/f1/sorting/list">F1排序</a></dd>
                        <dd class=""><a href="/f2/sorting/list">F2-Tab1排序</a></dd>
                        <dd class=""><a href="/f2/recordSorting/list">F2-Tab2排序</a></dd>
                        <dd class="layui-this"><a href="/channel/list">F3频道管理</a></dd>
                    </dl>
                </li>
            
            
                <li class="layui-nav-item layui-nav-itemed"><a class="javascript:;" href="javascript:;">运营管理</a>
                    <dl class="layui-nav-child">
                        <dd class=""><a href="/review/list">评论管理</a></dd>
                        <dd class=""><a href="/user/message/home">系统消息</a></dd>
                        <dd class=""><a href="/feedback/list">用户反馈</a></dd>
                    </dl>
                </li>
            
            
                <li class="layui-nav-item layui-nav-itemed"><a class="javascript:;" href="javascript:;">统计信息</a>
                    <dl class="layui-nav-child">
                        <dd class=""><a href="/statistics/result/list">统计信息</a></dd>
                    </dl>
                </li>
            
            
                <li class="layui-nav-item layui-nav-itemed"><a class="javascript:;" href="javascript:;">用户管理</a>
                    <dl class="layui-nav-child">
                        <dd class=""><a href="/user/list">用户管理</a></dd>
                    </dl>
                </li>
            
            
                <li class="layui-nav-item layui-nav-itemed"><a class="javascript:;" href="javascript:;">系统管理</a>
                    <dl class="layui-nav-child">
                        <dd class=""><a href="/admin/user/list">后台帐号管理</a></dd>
                        <dd class=""><a href="/multi_app/list">App管理</a></dd>
                    </dl>
                </li>
            
            <li class="layui-nav-item" style="height: 30px; text-align: center"></li>
        </ul>
    </div>
</div>

    <div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
        <div class="layui-body layui-tab-content site-demo site-demo-body">
            <div class="mian">
                <a class="layui-btn layui-btn-small layui-btn-danger" href="/channel/list">返回频道管理</a>
                <form class="layui-form enen" action="/channel/save.json">
                    <div class="title">频道编辑</div>
                    <input type="hidden" name="channelId" value="0" class="layui-input">
                    <input type="hidden" name="status" value="0" class="layui-input">
                    <div class="layui-form-item">
                        <label class="layui-form-label">名称：</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" value="" required lay-verify="required"
                                   placeholder="请输入名称"
                                   autocomplete="off" class="layui-input" style="width:400px;">
                        </div>
                    </div>
                    <!-- 修改201810 -->
                    <div class="layui-form-item">
                        <label class="layui-form-label">关联类型：</label>
                        <div class="layui-input-block" style="float:left; margin-left:0px;">
                            <input type="radio" name="targetType" value="5" title="标准列表"
                             >
                            <input type="radio" name="targetType" value="6" title="机构"
                             >
                            <input type="radio" name="targetType" value="7" title="赛事"
							 >
							 <input type="radio" name="targetType" value="8" title="URL"
                             >
                        </div>
					</div>
					<div class="layui-form-item h5_url">
                        <label class="layui-form-label">H5 url：</label>
                        <div class="layui-input-block" style="width:120px;">
                            <input type="text" name="url" value="" required lay-verify="required"
                                   placeholder="请输入url"
                                   autocomplete="off" class="layui-input" style="width:400px;">
                        </div>
                    </div>
                    <!-- /修改201810 -->
                    <div class="layui-form-item">
                        <label class="layui-form-label">关联资源ID：</label>
                        <div class="layui-input-block" style="width:120px;">
                            <input type="text" name="targetId" value="0" required selectid
                                   lay-verify="required" placeholder="请输入关联资源ID"
                                   autocomplete="off" class="layui-input" style="width:200px;">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">排行权重：</label>
                        <div class="layui-input-block" style="width:120px;">
                            <input type="text" name="weight" value="0" required lay-verify="required"
                                   placeholder="请输入排行权重"
                                   autocomplete="off" class="layui-input" style="width:400px;">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">图标：</label>
                        <div class="img btn_upload">
                            
                            
                                <img src="http://hippostatic.oss-cn-beijing.aliyuncs.com/admin/images/tp/img_load.png">
                            
                            <div class="layui-input-block" style="opacity:0">
                                <input name="icon" type="hidden" value="" class="_up_tb">
                                <input type="file" name="imgFile" lay-type="file" class="layui-upload-file"
                                       style="width:263px; height:165px; ">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    

<div class="layui-footer footer footer-demo">
    <div class="layui-main">
        <p>2017 &copy; <a href="/">layui.com</a> MIT license</p>
    </div>
</div>
<div class="site-tree-mobile layui-hide"> <i class="layui-icon">&#xe602;</i> </div>
<div class="site-mobile-shade"></div>
</div>
<script src="http://hippostatic.oss-cn-beijing.aliyuncs.com/admin/layui.js"></script>
<script src="http://hippostatic.oss-cn-beijing.aliyuncs.com/admin/js/fun.js"></script>




<!--弹出层-->
<div class="lay_select" style="display: none; z-index: 2000;">
    <div class="serch">
        <a class="close"><img src="http://hippostatic.oss-cn-beijing.aliyuncs.com/admin/images/close_btn.png"></a>
        <form action="/ref/ref.json" method="post" class="layui-form enen" >
            <div class="layui-input-inline" style=" width: 100px;">
                <select name="s_type" class="typeid" >
                    
                    <option value="1"
                            >图文</option>
                    <option value="2"
                            >视频</option>
                    <option value="3"
                            >直播</option>
                    <option value="4"
                            >系列</option>
                    <option value="5"
                            >标准列表</option>
                    <option value="6"
                            >机构</option>
                    <option value="7"
                            >赛事</option>
                    <option value="8"
                            >系列分类</option>
                    
                    <option value="10"
                            >频道</option>
                </select>
            </div>
            
                
            
            <div class="layui-input-inline">
                <a class="sear_btn layui-btn" href="javascript:;" />搜索</a>
            </div>
            <a  class="layui-btn layui-btn-danger" href="javascript:;" />确认</a>

        </form>
    </div>
    <div class="conent">
        <ul class="list">

        </ul>
    </div>
    <div id="demo1"></div>
</div>
<!--/弹出层-->
<script>
    layAjax.init()
</script>
<script>
    $(".btn_upload").each(function (index, element) {
        var btn = $(this).find("img");
        var file = $(this).find(".layui-upload-file");
        btn.click(function () {
            file.click();
            window.self = $(this);
        })
        layui.use('upload', function () {
            layui.upload({
                url: '/upload/image.json'
                , elem: file //指定原始元素，默认直接查找class="layui-upload-file"
                , method: 'post' //上传接口的http类型
                , success: function (res) {
                    $(window.self).parents(".btn_upload").find("[type=hidden]").val(res.url)
                    $(window.self).parents(".btn_upload").find("img").attr("src", res.url)
                }
            });
        });
    });
    layui.use('form', function () {
        var form = layui.form();
        form.on('switch(switchTest)', function (data) {
            layer.tips('开关checked：' + (this.checked ? 'true' : 'false'), data.othis)
        });
        //监听提交
        form.on('submit(formDemo)', function (data) {
            //layer.msg(JSON.stringify(data.field));
            $.ajax({
                url: "/channel/save.json",
                data: data.field,
                type: "POST",
                dataType: "json",
                success: function (data) {
                    layer.msg(data.resmsg);
                    if (data.rescode == 0) {
                        setTimeout(function () {
                            location = "/channel/list";
                        }, 500)
                    }
                },
                error: function (er) {
                    BackErr(er);
                }
            });
            return false;
        });
           
    });
           //新增加201810
            function hideH5(){
                $(".h5_url").hide()
                $(".h5_url input").attr("lay-verify","")
            }
            function showH5(){
                $(".h5_url").show();
                $(".h5_url input").attr("lay-verify","required")
            }
            $(".layui-input-block").on('click','.layui-unselect',function(){
                var text =$(this).find("span").text();
                if(text=="URL"){
                    showH5()
                }
                else
                {
                    hideH5()
                }
           });
</script>
</body>
</html>